Public Class GradientPanel
    Private _icon As System.Drawing.Bitmap
    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        MyBase.OnPaint(e)

        If e.ClipRectangle.IsEmpty Then Exit Sub
        'Add your custom paint code here
        Dim gBrush As New System.Drawing.Drawing2D.LinearGradientBrush(e.ClipRectangle, System.Drawing.Color.White, System.Drawing.Color.LightGray, Drawing2D.LinearGradientMode.Vertical)

        e.Graphics.FillRectangle(gBrush, 0, 0, Me.Width, Me.Height)

        If Not _icon Is Nothing Then
            e.Graphics.DrawImage(_icon, 8, 8, 32, 32)
        End If
        e.Graphics.FillRectangle(Brushes.LightGray, 48, 2, e.ClipRectangle.Width - 50, e.ClipRectangle.Height - 4)
        e.Graphics.DrawRectangle(Pens.Gray, 48, 2, e.ClipRectangle.Width - 51, e.ClipRectangle.Height - 5)
        e.Graphics.DrawRectangle(System.Drawing.Pens.White, -1, 1, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 3)
        e.Graphics.DrawRectangle(System.Drawing.SystemPens.WindowFrame, 0, 0, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1)
        Dim SF As New StringFormat(StringFormat.GenericDefault)
        SF.Alignment = StringAlignment.Center
        SF.LineAlignment = StringAlignment.Center
        e.Graphics.DrawString(Me.Text, Me.Font, Brushes.Black, New RectangleF(48, 2, e.ClipRectangle.Width - 50, e.ClipRectangle.Height - 4), SF)
    End Sub
    Public Property Icon() As System.Drawing.Bitmap
        Get
            Return _icon
        End Get
        Set(ByVal value As System.Drawing.Bitmap)
            _icon = value
        End Set
    End Property
End Class
